package org.pettyfox.pfpay.controller;

import org.pettyfox.pfpay.config.SiteProp;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;

import javax.annotation.Resource;

/**
 * 后台管理页面，需要登录访问
 */
@Controller
@RequestMapping("")
public class PageController {
    @Resource
    private SiteProp siteProp;

    /**
     * 首页
     * @param model
     * @return
     */
    @GetMapping("")
    public String index(Model model){
        model.addAttribute("site",siteProp);
        return "index";
    }
    /**
     * 收款配置
     * @param model
     * @return
     */
    @GetMapping("payalone")
    public String payalone(Model model){
        model.addAttribute("site",siteProp);
        return "payalone";
    }

    /**
     * 登录
     * @param model
     * @return
     */
    @GetMapping("/login")
    public String login(Model model){
        model.addAttribute("site",siteProp);
        return "login";
    }
}
